<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStoreAccountsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('store_accounts', function (Blueprint $table) {
            $table->id();
            $table->integer('sid')->default(0)->comment('商店ID');
            $table->integer('score')->default(100)->comment('评分');
            $table->integer('deposit')->default(0)->comment('保证金');
            $table->integer('balance')->default(0)->comment('余额');
            $table->integer('coin')->default(0)->comment('金币');
            $table->timestamps();
            $table->index('sid');
        });
        DB::statement("ALTER TABLE `store_accounts` comment '商店账户表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('store_accounts');
    }
}
